#include<stdio.h>
int main(){
	int T,b;
	scanf("%d",&T);
	int N,a[1000],i,t=0,j;
	int s=0,c=0,sum=0;
	for(b=0;b<T;b++){
		scanf("%d",&N);
		for(i=0;i<N;i++){
			scanf("%d",a[i]);
		}
		if(N==1){
			s=a[0]*6+5;
		}
		else{
		
		
			  t=N*5;		
			  for(j=0;j<N;j++){
				if(a[i+1]>a[i]){
					s=s+(a[i+1]-a[i])*6;
						
					}
					else{
						c=c+(a[i]-a[i+1])*4;
					}
			}
			
			sum=a[0]*6+s+c+t;
			}
	printf("%d",sum);
	s=0,c=0,t=0,sum=0;
	printf("\n");
		
	}
	
	return 0;
}
